<template>
  <div class="comment-item">
    <img
      src="http://10.31.169.37:3000/images/定制/矢量智能对象 拷贝.png"
      alt=""
    />
    <div class="cm-main">
      <div>
        {{ commentdata.username }}
        <van-rate
          v-model="commentdata.rate"
          size="12px"
          color="rgb(100,200,201)"
          allow-half
          readonlys
        />
        <div class="zan">
          {{ commentdata.zan
          }}<img src="http://10.31.169.37:3000/images/定制/点赞.png" alt="" @click="commentdata.zan++"/>
        </div>
      </div>
      <h6>{{ commentdata.time }}</h6>
      <p>
        {{ commentdata.content }}
      </p>
    </div>
  </div>
</template>

<script>
import { Rate } from "vant";
export default {
  props: ["commentdata"],
  data() {
    return {};
  },
  components: {
    VanRate: Rate,
  },
};
</script>

<style lang="less">
.comment-item {
  display: flex;
  justify-content: flex-start;
  img {
    width: 40px;
    height: 40px;
    margin-top: 10px;
  }
  .cm-main {
    flex: 1;
    padding: 10px;
    font-size: 14px;
    border-bottom: 1px solid #ccc;
    div {
      display: flex;
      justify-content: flex-start;
      align-items: center;
      color: rgb(99, 200, 200);
      .zan {
        margin-left: auto;
        font-size: 12px;
        img {
          width: 15px;
          height: 15px;
          margin: -5px 0 0 5px;
        }
      }
    }
    h6 {
      margin: 5px 0;
      color: #ccc;
      font-weight: 100;
      font-size: 12px;
    }
    p {
      width: 100%;
      font-size: 14px;
      display: -webkit-box;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 3;
      text-overflow: ellipsis;
      overflow: hidden;
      letter-spacing: 2px;
      font-weight: 400;
    }
  }
}
</style>
